package com.daikit.commons.shared.exception;

import com.daikit.commons.shared.exception.utils.DkExceptionMessageProvider;



/**
 * Exception that should be thrown at application initialization time.
 *
 * @author tcaselli
 * @version $Revision$ Last modifier: $Author$ Last commit: $Date$
 */
public class DkInitializationException extends DkException
{

	private static final long serialVersionUID = -8369861339925202855L;

	/**
	 * Default Constructor. This one should not be used but is here for serialization purpose.
	 */
	@Deprecated
	public DkInitializationException()
	{
		super();
	}

	/**
	 * Constructs a new DkInitializationException with given message. Create a Context that can be accessed by
	 * {@link #getContext()}.
	 *
	 * @param code
	 *           the exception code
	 * @param message
	 *           the message for the exception
	 */
	public DkInitializationException(final String code, final String message)
	{
		super(code, DkExceptionMessageProvider.format(code, message));
	}

	/**
	 * Constructs a new DkInitializationException with given message. Create a Context that can be accessed by
	 * {@link #getContext()}.
	 *
	 * @param code
	 *           the exception code
	 * @param message
	 *           the exception message
	 * @param cause
	 *           the cause (which is saved for later retrieval by the {@link #getCause()} method). (A <tt>null</tt> value
	 *           is permitted, and indicates that the cause is nonexistent or unknown.)
	 */
	public DkInitializationException(final String code, final String message, final Throwable cause)
	{
		super(code, DkExceptionMessageProvider.format(code, message), cause);
	}

	/**
	 * Constructs a new DkInitializationException with given message. Create a Context that can be accessed by
	 * {@link #getContext()}.
	 *
	 * @param code
	 *           the exception code
	 * @param message
	 *           the message for the exception
	 * @param optionalMessageArgs
	 *           optional message arguments
	 */
	public DkInitializationException(final String code, final String message, final Object... optionalMessageArgs)
	{
		super(code, DkExceptionMessageProvider.format(code, message, optionalMessageArgs));
	}

	/**
	 * Constructs a new DkInitializationException with given message. Create a Context that can be accessed by
	 * {@link #getContext()}.
	 *
	 * @param code
	 *           the exception code
	 * @param message
	 *           the exception message
	 * @param cause
	 *           the cause (which is saved for later retrieval by the {@link #getCause()} method). (A <tt>null</tt> value
	 *           is permitted, and indicates that the cause is nonexistent or unknown.)
	 * @param optionalMessageArgs
	 *           optional message arguments
	 */
	public DkInitializationException(final String code, final String message, final Throwable cause, final Object... optionalMessageArgs)
	{
		super(code, DkExceptionMessageProvider.format(code, message, optionalMessageArgs), cause);
	}
}
